<?xml version="1.0" encoding="utf-8"?>  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui">
<f:view locale="#{UserBean.locale}">
	<h:head>
		<link rel="shortcut icon" href="#{request.contextPath}/resources/images/favicon.ico" />
		<ui:insert name="meta"></ui:insert>
		<title><ui:insert name="title">#{msg.project_title}</ui:insert></title>
		<h:outputStylesheet name="MasterStyle.css" library="css"/>
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
	</h:head>
	<h:body styleClass="contentBody">
		<div id="main_container" class="min-width">
			<!-- Login Status -->
			<h:panelGroup style="float: right; padding: 2px 2px 0 0; text-align: right" layout="block">
				<h:form id="logoutForm">
					<h:panelGroup style="text-align: right" layout="block">
						<h:commandLink value="Eng" action="#{UserBean.setLocale('en','')}"/> 
					| <h:commandLink value="繁" action="#{UserBean.setLocale('zh','TW')}"/>
						<ui:remove>
					| <h:commandLink value="简" action="#{UserBean.setLocale('zh','CN')}" />
						</ui:remove>
						<br />
						<br />
					</h:panelGroup>
					<h:panelGroup rendered="#{UserBean.loggedIn}" layout="block">
						#{msg.general_login_as} [#{UserBean.user.userId}]
						<br />
						<h:commandLink value="#{msg.general_logout}" action="#{UserBean.logout}"></h:commandLink>
						<br />
						<h:outputLink value="#{request.contextPath}/pages/changePassword.xhtml">#{msg.general_change_password}</h:outputLink>
						<br />
					</h:panelGroup>
				</h:form>

			</h:panelGroup>
			<!-- Banner -->
			<ui:include src="Banner.xhtml" />
			<!--TopBar -->
			<ui:insert name="toptoolsbar">
				<ui:include src="TopToolsBar.xhtml" />
			</ui:insert>

			<!-- content  -->
			<div id="content_container" style="" class="min-width">
				<div style="width: 100%;">
					<ui:insert name="content"></ui:insert>
					
					<ui:remove>
					<!-- REMOVED -->
					<h:panelGroup rendered="#{empty UserBean.getAccessLevel() or UserBean.getAccessLevel() != 'NONE'}">
						<ui:insert name="content"></ui:insert>
					</h:panelGroup>
					<h:panelGroup rendered="#{UserBean.getAccessLevel() == 'NONE'}">
						<h:outputText value="#{msg.access_denied}" />
					</h:panelGroup>
					</ui:remove>
				</div>
				<table width="100%">
					<tr>
						<td width="100" valign="top"><ui:insert name="left"></ui:insert></td>
						<td valign="top">
							<ui:insert name="right"/>
						</td>
						<ui:remove>
						<td valign="top"><h:panelGroup rendered="#{UserBean.getAccessLevel() != 'NONE'}">
								<ui:insert name="right"></ui:insert>
							</h:panelGroup> <h:panelGroup rendered="#{UserBean.getAccessLevel() == 'NONE'}">
								<h:outputText value="#{msg.access_denied}" />
							</h:panelGroup></td>
						</ui:remove>
							
							
					</tr>
				</table>
			</div>
			<!--content  end -->
			<div style="float:right">
				<p:ajaxStatus style="width:16px;height:16px" id="ajaxStatusPnl">
					<f:facet name="start">
						<h:graphicImage library="images" name="smallIcons/loading.gif"/>
					</f:facet>
					<f:facet name="complete">
						<h:outputText value="" />
					</f:facet>
				</p:ajaxStatus>
			</div>
			<div style="text-align:center;float:center; margin: auto; padding-top: 0px" class="footer_text">
				<h:outputLabel value="©#{msg.project_right}"/>
			</div>
		</div>
	</h:body>
</f:view>
</html>